package ch4;

import java.util.Scanner;

public class GotAvg {

	public static void main(String[] args) {
		// 计算5门课的平均分
		double total = 0;
		Scanner in = new Scanner(System.in);
		System.out.println("请输入学生姓名：");
		String name = in.next();
		for (int i = 1; i <= 5; i++) {
			System.out.println("请输入第" + i + "门课的成绩：");
			double score = in.nextDouble();

			total += score;
		}
		double avg = total / 5;
		System.out.println(name + "5门课的平均分是" + avg + "分");
	}

}
